home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / tydhtml / dyn.exe / Chap06 / dyn6_6.txt < prev   
Encoding:
Text File  |  1997-10-02  |  2.3 KB  |  60 lines

  1. <HTML>
  2.  
  3. <HEAD>
  4.  
  5. <TITLE>Events galore</TITLE>
  6.  
  7. </HEAD>
  8.  
  9. <SCRIPT language="javascript">
  10.  
  11. function stopLink() {
  12.  
  13.   alert("You really don't want to go there");
  14.  
  15.   return false;
  16.  
  17. }
  18.  
  19. function changeHead(chosenHead) {
  20.  
  21.   if (chosenHead == "head_0")
  22.  
  23.     document.all(chosenHead).className  = "reallyBig";
  24.  
  25.   else if (chosenHead == "head_1")
  26.  
  27.     document.all(chosenHead).className = "reallySmall";
  28.  
  29. }
  30.  
  31. function changeBack(chosenHead) {
  32.  
  33.   document.all(chosenHead).className = "";
  34.  
  35. }
  36.  
  37. function shiftItalics(theCode) {
  38.  
  39.   if (theCode == 13) //13 is ascii for return
  40.  
  41.     document.all("para_0").style.fontStyle = "italic";
  42.  
  43.   else if (theCode == 32) 
  44.  
  45.     document.all("para_0").style.fontStyle = "normal";
  46.  
  47. }
  48.  
  49. </SCRIPT>
  50.  
  51. <STYLE type="text/CSS">
  52.  
  53. BODY {margin-left: 0.75in; margin-right: 0.75in; margin-top: 0.10in}
  54.  
  55. H1, H2 {font-family: verdana, helvetica, arial, sans-serif}
  56.  
  57. H1 {font-size:24pt; text-align:left}
  58.  
  59. H2 {font-size:12pt; text-align:right}
  60.  
  61. P {font-family:garamond; font-size:12pt}
  62.  
  63. P.left {text-align:left}
  64.  
  65. P.right {text-align:right}
  66.  
  67. A {text-decoration: none; font-weight: bold}
  68.  
  69. .reallyBig {font-size:72pt}
  70.  
  71. .reallySmall {font-size:4pt}
  72.  
  73. </STYLE>
  74.  
  75. <BODY bgcolor="white" onKeypress="shiftItalics(event.keyCode)">
  76.  
  77. <H1 id="head_0" onMouseover="changeHead('head_0')" 
  78.  
  79. cc]onMouseOut="changeBack('head_0')">
  80.  
  81. Lorem ipsum dolor sit amet</H1>
  82.  
  83. <P id="para_0" class="left">Consectetur 
  84.  
  85. <A href="sint.html" title="Dodecendesse" onClick="stopLink()">
  86.  
  87. adipisci tempor</A> incidunt ut labore et dolore magna aliqu atib saepe 
  88.  
  89. eveniet ut er reupdiand sint. Nos arsapiente delectus au aut prefer endis 
  90.  
  91. dol tene sententiam, quid est cur verear ne ad eam nc quos tu paulo ante 
  92.  
  93. memorite tum etia ergat.</P> 
  94.  
  95. <H2 id="head_1">Tomporibud autem quinus</H2>
  96.  
  97. <P id="para_2" class="right" onMousedown="changeHead('head_1')"
  98.  
  99. cc]onMouseup="changeBack('head_1')">
  100.  
  101. Atib saepe eveniet ut er 
  102.  
  103. <A href="tempor.html" title="Eveniet" onClick="stopLink()">
  104.  
  105. repudiand sint</A> et molestia tenetury sapiente 
  106.  
  107. delctus au aut prefer endis dol. Endiumagist and et dodecendesse 
  108.  
  109. videantur, iustitiam, aequitated fidem. Neque hominy infant efficerd 
  110.  
  111. possit duo contend notiner si effecerit. Natura proficis facile explent 
  112.  
  113. sine julla unura aute enim desiderable.</P>
  114.  
  115. </BODY>
  116.  
  117. </HTML>
  118.  
  119.